#pragma once
#include <iostream>
#include <pthread.h>
#include <functional>

using namespace std;

using task_t = function<void(int sock, const std::string clientip, uint16_t port)>;

class Task
{
public:
    Task()
    {
    }

    Task(int sock, const std::string clientip, uint16_t port, task_t func)
    :_sock(sock),_clientip(clientip),_port(port),_func(func)
    {

    }

    void operator()()
    {
        _func(_sock,_clientip,_port);
    }

    ~Task()
    {
    }

private:
    int _sock;
    std::string _clientip;
    uint16_t _port;
    task_t _func;
};
